﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using KeepAnimals.BLL;
using KeepAnimals.DAL;


namespace KeepAnimals
{
    class Program
    {
        static void Main(string[] args)
        {
            // Connection bdd = new Connection();

            //#region
            //Animal littleDog = AnimalFactory.CreateAnimal(Animal.ANIMAL_DOG);
            //littleDog.Name = "TotoDog";
            //littleDog.Age = 2;
            //littleDog.DateArrival = DateTime.Today;
            //littleDog.Weight = 13;
            //littleDog.IdCategory = Animal.ANIMAL_DOG;
            //littleDog.Id = littleDog.AddAnimalInDatabase();
            //Console.WriteLine("\n");
            //Console.WriteLine("Ancien nom :"+littleDog.Name + " à été ajouté a la base de donnée avec l'id " + littleDog.Id);

            //littleDog.Name = "Lilou";
            //littleDog.UpdateAnimalInDatabase();
            //Console.WriteLine("\n");
            //Console.WriteLine("Nouveau nom :" + littleDog.Name + " à été modifié a la base de donnée avec l'id " + littleDog.Id);

            //Console.WriteLine(littleDog.Name +" à été ajouté a la base de donnée avec l'id "+littleDog.Id);
            //Console.WriteLine("\n");

            //Box box1 = new Box();
            //box1.IdAnimal = littleDog.Id;
            //box1.Empty = Box.BOX_EMPTY;
            //box1.Id = box1.AddBoxInDatabase();
            //littleDog.IdBox = box1.Id;
            //littleDog.UpdateAnimalInDatabase();
            //Console.WriteLine("Box 1 à été ajouté a la base de donnée avec l'id " + box1.Id);
            //Console.WriteLine("\n");
            //List<Animal> animals = new List<Animal>();
            //animals = Animal.GetListOfAllAnimals();
            //foreach (var animal in animals)
            //{
            //    Console.WriteLine("id de l'animal : "+animal.Id);
            //    Console.WriteLine("Nom de l'animal l'animal : " + animal.Name);

            //}
            //Console.WriteLine("\n");
            //Connection.DelInDatabase(Connection.TABLE_NAME_ANIMALS, 20);
            //Console.WriteLine("l'animal avec l'id 20 a bien été supprimé ");
            //Console.WriteLine("\n");
            //Console.WriteLine("\n");
            //Console.WriteLine("Récupération de l'animal avec id 4");
            //Animal testAnim = Animal.GetAnimalById(18);
            //Console.WriteLine("id de l'animal : " + testAnim.Id);
            //Console.WriteLine("Nom de l'animal l'animal : " + testAnim.Name);
            //Console.WriteLine("l'animal avec id 18");
            //Console.WriteLine("\n");

            //Department dep = new Department();
            //dep.Empty = Department.BOX_FULL;
            //dep.Id = dep.AddDepartmentInDatabase();
            //Console.WriteLine("Le department " +dep.Id+" à bien été ajouté en base de donnée");
            //Connection.DelInDatabase(Connection.TABLE_NAME_BOX, 9);
            
            //Console.WriteLine("\n");
            //List<Box> boxs = new List<Box>();
            //boxs = Box.GetListOfAllBox();
            //foreach (var box in boxs)
            //{
            //    Console.WriteLine("id du box : " + box.Id);

            //}
            //Box boxes = new Box();
            //boxes.IdDepartment = 1;
            //boxes.IdAnimal = littleDog.Id;
            //boxes.AddBoxInDatabase();

            //Animal petitPet = Animal.GetAnimalByIdBox(19);
            //Console.WriteLine("nom de petitPet :" + petitPet.Name);

            //Console.ReadLine();
            //#endregion

            // Creation de la base de données



            //#region
            //Department dep1 = new Department();

            //Department dep2 = new Department();

            //Department dep3 = new Department();

            //Department dep4 = new Department();




            //int idDep1 = dep1.AddDepartmentInDatabase();

            //int idDep2 = dep2.AddDepartmentInDatabase();

            //int idDep3 = dep3.AddDepartmentInDatabase();

            //int idDep4 = dep4.AddDepartmentInDatabase();




            //Box box1 = new Box();

            //Box box2 = new Box();

            //Box box3 = new Box();

            //Box box4 = new Box();

            //box1.IdDepartment = idDep1;

            //box2.IdDepartment = idDep1;

            //box3.IdDepartment = idDep1;

            //box4.IdDepartment = idDep1;




            //Box box5 = new Box();

            //Box box6 = new Box();

            //Box box7 = new Box();

            //box5.IdDepartment = idDep2;

            //box6.IdDepartment = idDep2;

            //box7.IdDepartment = idDep2;







            //Box box8 = new Box();

            //Box box9 = new Box();

            //Box box10 = new Box();

            //Box box11 = new Box();

            //Box box12 = new Box();

            //box8.IdDepartment = idDep3;

            //box9.IdDepartment = idDep3;

            //box10.IdDepartment = idDep3;

            //box11.IdDepartment = idDep3;

            //box12.IdDepartment = idDep3;




            //Box box13 = new Box();

            //Box box14 = new Box();

            //box13.IdDepartment = idDep4;

            //box14.IdDepartment = idDep4;




            //box1.AddBoxInDatabase();

            //box2.AddBoxInDatabase();

            //box3.AddBoxInDatabase();

            //box4.AddBoxInDatabase();

            //box5.AddBoxInDatabase();

            //box6.AddBoxInDatabase();

            //box7.AddBoxInDatabase();

            //box8.AddBoxInDatabase();

            //box9.AddBoxInDatabase();

            //box10.AddBoxInDatabase();

            //box11.AddBoxInDatabase();

            //box12.AddBoxInDatabase();

            //box13.AddBoxInDatabase();

            //box14.AddBoxInDatabase();
            //#endregion

        }
    }
}
